#!/bin/bash
OK=0
WARN=1
CRITICAL=2
UNKNOWN=3
PATH="/bin:/sbin:/usr/bin:/usr/sbin"

Ok_name=''
Fail_name=''
Judge=0

function mount_l() {
                #/bin/mount -l > /tmp/mount_l_tmp
		#Temp=`grep $2 /tmp/mount_l_tmp |grep $1`
		Temp=`/bin/mount -l|grep $2 |grep $1`
		if [ "t$Temp" == "t" ]
		then
                        Judge=1
                        Fail_name="${Fail_name} ${choice}"
                else
                        Ok_name="${Ok_name} ${choice}"
                fi
                       
		#continue

}



for choice in parastor
do
	case $choice in
	parastor)						   ###
		mount_l  rw "$choice"
		;;

	esac

done

/bin/rm -f /tmp/mount_l_tmp

if [ $Judge -eq 1 ]
then
	echo "mount -l $Fail_name  wrong satus"
	exit $CRITICAL
else
	echo " $Ok_name are OK "
	exit $OK
fi

